#include <54func.h>
int main(int argc,char *argv[])
{
    // ./16_close_pipe_read.c 1.pipe
    ARGS_CHECK(argc,2);
    int fdr = open(argv[1],O_RDONLY);
    ERROR_CHECK(fdr,-1,"open");
    printf("read side is opened!\n");
   
    //写操作！！！
    char buf[1024] = {0};
    ssize_t sret = read(fdr,buf,sizeof(buf));
    ERROR_CHECK(sret,-1,"read");
    sleep(5);
    printf("sret = %ld,buf = %s\n",sret,buf);
    printf("read over!\n");
    //while(1){
    //    sleep(1);
    //}
    close(fdr);
    return 0;
}
